Skip to content

EC2: fix interface endpoint ENI IP, security groups and MAC format - #304

Open
nik-localstack wants to merge 2 commits into
localstackfrom
aws-2745-endpoint-eni
Open

nik-localstack wants to merge 2 commits into
localstackfrom
aws-2745-endpoint-eni

Conversation

@nik-localstack

Copy link
Copy Markdown

Motivation

Interface VPC endpoints' network interfaces get a random private IP outside their subnet and the VPC's default security group instead of the endpoint's, and every ENI's MAC address is malformed (e.g. 2:4a:... instead of 02:4a:...). Tracked as AWS-2745.

Changes

  • Cherry-pick of upstream EC2: fix MAC address format getmoto/moto#9980 (MAC address format).
  • create_vpc_endpoint lets create_network_interface allocate an IP from the subnet, applies the requested security groups, and sets the interface as vpc_endpoint, requester-managed and in-use, as AWS does.
  • New @aws_verified test test_create_interface_vpc_endpoint_network_interfaces: passes against AWS and moto, and fails without the fix.

Only newly created endpoints are affected; ENIs already in persisted state keep their old values.

🤖 Generated with Claude Code

hellozzm and others added 2 commits November 10, 2026 14:30
…'s security groups

create_vpc_endpoint gave the endpoint's network interface a random private IP outside
the subnet and the VPC's default security group. It now lets create_network_interface
pick an address from the subnet, applies the requested security groups, and marks the
interface as a requester-managed vpc_endpoint interface in use.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nik-localstack
nik-localstack marked this pull request as ready for review November 11, 2026 10:22

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants